#!/bin/bash


docker stop $(docker ps -a -f "ancestor=transponderwebapi" -q)
docker rm $(docker ps -a -f "ancestor=transponderwebapi" -q)
docker rmi  transponderwebapi --force


DIR="/root/Iot-device-docking-with-en-niu-platform"

if [ -d "$DIR" ]; then
    cd Iot-device-docking-with-en-niu-platform
    git pull
else
    git  clone https://gitee.com/m694548114/Iot-device-docking-with-en-niu-platform.git
fi
cd /root/Iot-device-docking-with-en-niu-platform/Transponder_NetCore
docker build -f  ./Transponder_WebApp/Dockerfile . -t transponderwebapi
cd /root/Iot-device-docking-with-en-niu-platform/Doc/docker-compose-files

docker compose   -f docker-compose-webapi.yml -p transponder  down 
docker compose   -f docker-compose-webapi.yml -p transponder  up -d